import java.io.*;
import java.util.ArrayList;

public class ReadFile {
	private String input_filename = "";
	String delimiter = ";";
	ArrayList<String> eleTxt = new ArrayList<String>();
	BufferedReader bufRead;
	FileReader input;

	// ********************Constructor**********************************//
	public ReadFile() {
		setInput_filename("");
	}

	public ReadFile(String input_filename) throws IOException {

		setInput_filename(input_filename);
		input = new FileReader(getInput_filename());
		bufRead = new BufferedReader(input);
	}

	public ArrayList<String> readText() throws IOException {

		String line = "";
		String temp[];
		line = bufRead.readLine();

		while (line != null) {
			temp = line.split(delimiter);
			if (temp != null) {
				eleTxt.add(temp[0]);
				if (line != null) {
					line = bufRead.readLine();
				}
			}
		}
		bufRead.close();
		Util.writeLog("\t - Read from file "+getInput_filename());
		return eleTxt;
	}

	// ****************Getter and Setter***************************//
	public String getInput_filename() {
		return input_filename;
	}

	public void setInput_filename(String inputFilename) {
		input_filename = inputFilename;
	}

}
